#include "ShfeShm.h"
#include <iostream>
#include "shfe_md_client.h"
using namespace std;

struct MyEdgeAlign {
    int a;
}__attribute__ ((aligned (64)));

static struct MyEdgeAlign edge1;
static struct MyEdgeAlign edge2;
static ShfeShmProducer gProducer;


void L5DataHandler(const struct InflateL5TickData *data) {
	gProducer.WriteData(const_cast<InflateL5TickData* > (data));
}

int main(int argc, char *argv[]) {
	char *default_shm_name = "20210601" ;
	
	
	if(!gProducer.Create(default_shm_name)) {
		cout << "Create ShareMem " << default_shm_name << " Failed" << endl;
		return -1;
	}
	
		gProducer.WriteInfoEnd();
        int j=0;
		while(1) {
            struct  InflateL5TickData data = {};
            data.volume = j++;
		    L5DataHandler(&data);
            sleep(10);
		}
	cout << "Exit" << endl;
}
